Skip to content

Update 'Content-Length' value for fix characters missing #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2016

Conversation

EthianWong
Copy link
Contributor

In other languages (Chinese , Japanese .... )
One word maybe use two or three bytes ...

var a = "我爱你";
console.log(a.length); //3
console.log(new Buffer(a).length); //9

So you should use new Buffer for set "Content-Length" and this problem will be resolve

@niemyjski
Copy link
Member

I'm trying to figure out what the core fix is here as It's broken on desktop as well (outside of Buffer)

@niemyjski niemyjski merged commit c9988f5 into exceptionless:master Nov 11, 2016
@niemyjski
Copy link
Member

Thank you for this change. I'm going to test it further and then deploy a release

@niemyjski
Copy link
Member

I changed this up to use Buffer.byteLength(request.data) instead as Buffer(string).length returns the allocated memory length instead of the actual byte count

@niemyjski
Copy link
Member

niemyjski added a commit that referenced this pull request Nov 11, 2016
@niemyjski
Copy link
Member

This has been deployed (https://github.com/exceptionless/Exceptionless.JavaScript/releases/tag/v1.4.2) Thank you for your contributions!

@EthianWong
Copy link
Contributor Author

You're welcome~ This is my first time to contributions in github~ make me exciting

@niemyjski
Copy link
Member

We greatly appreciate it and would love to have you apart of our community :). Please feel free to hang out and chat with other developers on our slack channel: slack.exceptionless.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants